package com.longcai.controller.choice;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.longcai.util.ChoiceJDUtil;
import com.longcai.util.ChoiceTBKUtil;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author LWK
 * @since 2019-04-15
 */
@Controller
@RequestMapping("/clyjChoice")
public class ClyjChoiceController {
	/**
	 * 获取JD第三方精选商品
	 */
	@RequestMapping("/getJdData")
	@ResponseBody
	public Map<String,Object> getJdData(Integer eliteId,String sortName,String sort,Integer pageSize,Integer pageIndex){
		Map<String, Object> jdData = ChoiceJDUtil.getJdData(eliteId, sortName, sort, pageSize, pageIndex);
		return jdData;
	}
	/**
	 * 获取TBK第三方所有精选商品
	 */
	@RequestMapping("/getTbkData")
	@ResponseBody
	public Map<String,Object> getTbkData(String pageIndex){
		Map<String, Object> tbkData = ChoiceTBKUtil.getTBKData(pageIndex);
		return tbkData;
	}
	/**
	 * 获取TBK第三方首页精选商品
	 */
	@RequestMapping("/getTbkDataHome")
	@ResponseBody
	public Map<String,Object> getTbkDataHome(){
		Map<String, Object> tbkData = ChoiceTBKUtil.getTBKDataHome();
		return tbkData;
	}
	
	/**
	 *TB根据商品id以及淘宝id获取商品详情
	 */
	@RequestMapping("/getTbkDetail")
	@ResponseBody
	public Map<String,Object> getTbkDetail(String id,String goodsId,HttpServletRequest request){
		Map<String, Object> tbkData = ChoiceTBKUtil.getTbkDetail(id,goodsId,request);
		return tbkData;
	}
}

